package com.lanhai.enums;

public enum CaFlag {
	ON(1, "通行"),
	OFF(2, "封闭"),
	LM(3, "同向限行");
	
	private CaFlag(Integer code, String name){
		this.code = code;
		this.name = name;
	}
	private Integer code;
	private String name;
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
    public static String getValueByCode(Integer code){
        for(CaFlag cf:CaFlag.values()){
            if(code == cf.getCode()){
                return cf.getName();
            }
        }
        return  null;
    }
	
}
